import { createRouter, createWebHistory } from "vue-router";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path:"/",
      redirect:"/home/question"
    },
    {
      path: "/home",
      name: "home",
      component: () => import("@/views/Home.vue"),
      children:[
        {
          path:'question',
          name:"question",
          component:()=>import('@/views/Question.vue'),
          meta: {showBanner: true}
        },
        {
          path:'exam',
          name:"exam",
          component:()=>import('@/views/Exam.vue'),
          meta: {showBanner: true}
        },
        {
          path: 'user/exam',
          name: 'userExam',
          component: () => import('@/views/UserExam.vue'),
          meta: {showBanner: false}
        },
        {
          path: 'user/detail',
          name: 'userDetail',
          component: () => import('@/views/UserDetail.vue'),
          meta: {showBanner: false}
        }
      ]
    },
    {
      path: "/login",
      name: "login",
      component: () => import("@/views/Login.vue"),
    },
    {
      path: "/answer",
      name: "answer",
      component: () => import("@/views/Answer.vue"),
    },
  ],
});

export default router;
